import coordinate
import pandas as pd


if __name__ == "__main__":
    # ids = ["e03ed990de4c6db2", "fb266cec6e5736c9", "a5da784976d61fa9", "b174e34f27aa55b4",
    #        "537e73456b78e2ad"]
    # for aid in ids:
    #     df = pd.read_csv(r"F:\lvmiao\imgMsg\\"+aid+"_long_dropdup.txt")
    #     for i in range(len(df)):
    #         lon = df.loc[i]['lon']
    #         lat = df.loc[i]['lat']
    #         lat, lon = coordinate.gcj_To_Gps84(lat, lon)
    #         df.loc[i, 'lon'] = lon
    #         df.loc[i, 'lat'] = lat
    #     df.to_csv(r"F:\lvmiao\imgMsg\\"+aid+"_long_dropdup_transcoor.txt", index=False)
    #     print(aid)

    df = pd.read_csv(r"D:\BaiduNetdiskDownload\20190429\20190429_groundtruth.txt")
    for i in range(len(df)):
        lon = df.loc[i]['lon']
        lat = df.loc[i]['lat']
        lat, lon = coordinate.gcj_To_Gps84(lat, lon)
        df.loc[i, 'lon'] = lon
        df.loc[i, 'lat'] = lat
    df.to_csv(r"D:\BaiduNetdiskDownload\20190429\20190429_groundtruth.txt", index=False)